package api

import (
	"github.com/gin-gonic/gin"
	"renter/infrastructure/models"
)
import "renter/common/vo"

type RegisterCmd struct {
	Account  string `form:"account" json:"account"`
	Password string `form:"password" json:"password"`
}

type LoginCmd struct {
	Account  string `form:"account"`
	Password string `form:"password"`
}

func Register(c *gin.Context) {
	var register RegisterCmd
	_ = c.ShouldBind(&register)
	account := models.SelectAccountByAccount(register.Account)
	c.JSON(200, R.Ok(account))
}

func Login(c *gin.Context) {
	var register RegisterCmd
	_ = c.ShouldBind(&register)
	c.String(200, register.Account)
}
